package code.juc.threadlocal;

import lombok.SneakyThrows;

import java.util.concurrent.TimeUnit;

public class MainRun {

    @SneakyThrows
    public static void main(String[] args) {
        // ThreadLocal
        // System.out.println("Main: " + ThreadLocalTool.tool.get());

        // InheritableThreadLocal

        System.out.println("Main: " + InheritableThreadLocalTool.localExt.get());

        TimeUnit.SECONDS.sleep(1);

        new ThreadA().start();

        TimeUnit.SECONDS.sleep(1);

        InheritableThreadLocalTool.localExt.set("123123");
        System.out.println("Main: " + InheritableThreadLocalTool.localExt.get());
        System.out.println("设置完值了。。。。");
        TimeUnit.SECONDS.sleep(1);
    }
}
